package com.cabal.common.util;


import com.cabal.common.errcode.TmsConstant;

/**
 * @author shenkang
 * @create 2019-11-15
 */
public class TmsServiceException extends RuntimeException {
    private String code;

    public TmsServiceException(String code, String message) {
        super(message);
        this.code = code;
    }

    public TmsServiceException(String code, Throwable ex) {
        super(ex);
        this.code = code;
    }

    public TmsServiceException(String code, String message, Throwable ex) {
        super(message, ex);
        this.code = code;
    }

    public TmsServiceException(TmsConstant code) {
        super(code.getValue());
        this.code = code.getCode();
    }

    public TmsServiceException(TmsConstant code, String message) {
        super(message);
        this.code = code.getCode();
    }

    public TmsServiceException(TmsConstant code, Throwable ex) {
        this(code);
    }

    public TmsServiceException(TmsConstant code, String message, Throwable ex) {
        super(message, ex);
        this.code = code.getCode();
    }

    public String getCode() {
        return this.code;
    }
}
